home *** CD-ROM | disk | FTP | other *** search
- Path: news.cencom.net!netnews
- From: wsenn@cencom.net (Will Senn)
- Newsgroups: comp.lang.c++
- Subject: Re: getch() and cin
- Date: 22 Jan 1996 16:05:04 GMT
- Organization: Your Organization
- Message-ID: <4e0cjg$5rb@news.cencom.net>
- References: <4dncee$4g2@news.cencom.net> <4dnk7i$36ha@holly.ACNS.ColoState.EDU>
- NNTP-Posting-Host: macomb_ppp__04.cencom.net
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- X-Newsreader: WinVN 0.99.7
-
- >void main()
- >{
- > char Temp;
- >
- > cin.get(Temp);
- > while(Temp != '\n') cin.get(Temp);
- >
- > return;
- >}
- >-------------------------------------
- >
- >This will read a character at a time until the newline. The get()
- >member is what you want. Questions?
-
- Thanks, but what I need to know is how to read one character, be able to use
- that character, and NOT have to wait for the newline. i.e. The program
- prompts for input INPUT: , the user presses 'a', the program parses the 'a'
- to see if it is a 'c' then does whatever I want next. Definately not:
- INPUT: "a\n"
-
- Thanks,
- Will
-
-